<template>
<router-view/>
<!--   <div>-->
<!--       <input type="text" v-model="user.account">-->
<!--       <br>-->
<!--       <input type="password" v-model="user.password">-->
<!--       <br>-->
<!--       <input type="button" value="登录" @click="login">-->
<!--   </div>-->
<!--    <p>-->
<!--        {{$store.state.user}}-->
<!--    </p>-->
    <audio :src="this.$store.state.url" controls v-if="(!/^\/search-view/.test($route.path)) && this.$store.state.url!==''"></audio>
<TabBar v-if="!/^\/search-view/.test($route.path) && (!/^\/playmusic-view/.test($route.path))"/>
</template>

<script>
  import TabBar from "./components/tabBar/TabBar.vue";
  import axios from 'axios'
  import {getBanner} from "./api";

  export default {
  components:{
    TabBar
  },
    data(){
      return{
          user:{
              account:'',
              password:'',
              loginStatus:''
          },
          url:this.$store.state.url
      }
    },
    mounted() {
          getBanner('/login/status')
            .then(response=>{
                this.loginStatus=response.data
                console.log(this.loginStatus)
            })
    },
      methods:{
          login(){
              this.$store.dispatch('login',this.user)
              getBanner('/login/status')
                  .then(response=>{
                      this.loginStatus=response.data
                      console.log(this.loginStatus)
                  })
          },
    }
}
</script>

<style scoped>
audio{
    width: 100%;
    position: fixed;
    bottom:0;
    left: 0;
}
</style>